﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 

namespace zhangxinyu02
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        int i = 0;
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            i++;
            
            if (i % 2 == 1)
            {
                SoundPlayer p = new SoundPlayer();
                p.SoundLocation = Application.StartupPath + "//dog.wav";
                p.Load();
                p.Play();
                pictureBox1.Image = Image.FromFile(Application.StartupPath + "//dog.gif");
            }
            else {
                pictureBox1.Image = Image.FromFile(Application.StartupPath + "//dog.jpg");

            }
            

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}
